from fastapi import HTTPException
from typing import Any

from common.response.response_code import (
    CustomErrorCode, HttpCode
)

class CustomException(Exception):
    def __init__(
        self, 
        msg: str = None, 
        code: int = HttpCode.HTTP_400,
    ) -> None:
        self.code = code
        self.msg = msg
        
class HTTPError(HTTPException):
    def __init__(self, *, code: int, msg: Any = None, headers: dict[str, Any] | None = None):
        super().__init__(status_code=code, detail=msg, headers=headers)